﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Blueprint.Mobile
{
    public partial class MainForm : Form, IMainView
    {
        #region Constructor
        public MainForm()
        {
            InitializeComponent();
        }
        #endregion

        #region Properties (SelectedCategory)
        public Category SelectedCategory
        {
            get { return categoryComboBox.SelectedItem as Category; }
        }
        #endregion

        #region Actions (SetCategories, SetProducts)
        public void SetCategories(Category[] categories)
        {
            foreach(Category category in categories)
                categoryComboBox.Items.Add(category);
        }

        public void SetProducts(string products)
        {
            productsTextBox.Text = products;
        }
        #endregion

        #region Events (categoryComboBox_SelectedIndexChanged, doneMenuItem_Click)
        public event EventHandler CategorySelected;
        private void categoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if(CategorySelected != null)
                CategorySelected(this, null);
        }

        public event EventHandler Done;
        private void doneMenuItem_Click(object sender, EventArgs e)
        {
            if(Done != null)
                Done(this, null);
        }
        #endregion
    }
}